package com.zx.service.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import com.zx.service.UserService;


@Service
public class UserServiceImp implements UserService{
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	@Override
	public Map<?, ?> login(String name,String pwd) {
		String sql="select * from user where name=? and psw=?";
		try{ 
			return jdbcTemplate.queryForMap(sql,new Object[]{name,pwd});
        }catch (EmptyResultDataAccessException e) {  
            return null;  
        }  
		
	}

}
